{
  "properties" : { },
  "id" : "f8ddacee9f834025bc4b5e60c82d4666",
  "script" : null,
  "groupId" : "5b4c0f1fcedc4bfbbf84bb3791e01399",
  "name" : "新增告警规则",
  "createTime" : 1727070940348,
  "updateTime" : 1726797881371,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "save",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "{\n    \"expression\": \"%3E80\",\n    \"expressionType\": \"num\",\n    \"level\": 5,\n    \"ruleMetricId\": 17,\n    \"ruleName\": \"测试略略了\",\n    \"suppressInterval\": \"600\",\n    \"templateContent\": \"哦IE节日哦v额\",\n    \"unit\": \"kb\"\n}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"status\": 200,\n    \"message\": \"success\",\n    \"data\": 42\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  }
}
================================
import java.net.URLDecoder;

expression = URLDecoder.decode(body.expression, "UTF-8")
if (expression.contains("&&")){
    int num1 = Integer.parseInt(expression.substring(1, expression.indexOf("&&"))); // 提取第一个数字
    int num2 = Integer.parseInt(expression.substring(expression.lastIndexOf("<") + 1)); // 提取第二个数字
    if (num1 >= num2){
        return "表达式编辑错误"
    }
}
return db.insert("""
    insert into alarm_rule(expression, expression_type,level,rule_metric_id,rule_name,suppress_interval,template_content,unit) 
    values (#{expression}, #{body.expressionType},#{body.level},#{body.ruleMetricId},#{body.ruleName},
    #{body.suppressInterval},#{body.templateContent},#{body.unit})
""", 'id')